<script type='text/javascript'>

    $(document).ready(function(){

        //$("#id").autoNumeric({aSep: '.', aDec: ','});

        $("#btn_pilih_NOP").click(function(){
            $("#dialog-alert").dialog('open');
        });


        $("#cbJenisSk").change(function(){
            //            $("#dialog-objek").dialog('open');
            if($(this).val()!='01'){
                $("#coba").show();
            }else{
                $("#coba").hide();
            }
            
        });


    });


    function PilihNop(nama_pmk,no_op,alamat_pmk){
        alert('x'+nama_pmk+'x');
        $("#no_op").val(no_op);
        var no1=no_op.substring(0,1);
        var no2=no_op.substring(1,2);
        var no3=no_op.substring(2,3);
        var no4=no_op.substring(3,4);
        var no5=no_op.substring(4,5);
        var no6=no_op.substring(5,6);
        var no7=no_op.substring(6,7);
        var no8=no_op.substring(7,8);
        var no9=no_op.substring(8,9);
        var no10=no_op.substring(9,10);
        var no11=no_op.substring(10,11);
        var no12=no_op.substring(11,12);
        var no13=no_op.substring(12,13);
        var no14=no_op.substring(13,14);
        var no15=no_op.substring(14,15);
        var no16=no_op.substring(15,16);
        var no17=no_op.substring(16,17);
        var no18=no_op.substring(17,18);

        $("#no1").val(no1);
        $("#no2").val(no2);
        $("#no3").val(no3);
        $("#no4").val(no4);
        $("#no5").val(no5);
        $("#no6").val(no6);
        $("#no7").val(no7);
        $("#no8").val(no8);
        $("#no9").val(no9);
        $("#no10").val(no10);
        $("#no11").val(no11);
        $("#no12").val(no12);
        $("#no13").val(no13);
        $("#no14").val(no14);
        $("#no15").val(no15);
        $("#no16").val(no16);
        $("#no17").val(no17);
        $("#no18").val(no18);

        $("#nama_pmk").val(nama_pmk);

        //        $.ajax({
        //            type:"POST",
        //            url:"<?php //echo Yii::app()->createUrl('/Pembayaran/PemabayaranSetoranBank/GetNop');    ?>",
        //            data:"no_op="+no_op+"&kd_dati2="+$kd_dati2+"&kd_kecamatan="+$kd_kecamatan+"&kd_kelurahan="+$kd_kelurahan+"&kd_blok="+$kd_blok+"&no_urut="+$no_urut+"&kd_jns_op="+$kd_jns_op+"&thn_pajak="+$thn_pajak,
        //            dataType:"json",
        //            success:function(data){
        // 
        //        }
        // 
        //});

        //pecah=($("#no_op").val(no_op));
        //        var n=str.split(" ");
        //        document.getElementById("no_op").innerHTML=n;

        $("#alamat_pmk").val(alamat_pmk);

        $("#dialog-alert").dialog('close');						


    }


    function movetoNext(current, nextFieldID) {
        if (current.value.length >= current.maxLength) {
            document.getElementById(nextFieldID).focus();
        }
    }


</script>


<?php
if (Yii::app()->user->hasFlash('success'))
    $this->widget('bootstrap.widgets.TbAlert', array());

$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'horizontalForm',
    'type' => 'horizontal',
    'enableAjaxValidation' => false,
//    'action'=>Yii::app()->createUrl('');
        ));
?>

<legend>Form Pengisian Identitas Wajib Pajak</legend>
<br>

<?php echo $form->errorSummary($model); ?>
<div class="alert alert-success">A. Tanda Bukti Diri </div>
<div class="form">
    <br>
    <div class="control-group ">
        <label class="control-label" >Tanda Bukti Diri</label>
        <div class="controls">
            <?php
            echo $form->DropDownList($model, 'bukti_diri', array(
                'prompt' => 'Pilih',
                'KTP' => 'KTP',
                'SIM' => 'SIM',
                    ), array('class' => 'span1'));
            ?>

        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="TestForm_textField">Nomor Bukti Diri </label>
        <div class="controls">
                <input type = "text" name="no_induk[]" class="span1 numbersOnly" id="1" onkeyup="movetoNext(this, '2')" maxlength="1" style="width:20px;">
                <input type = "text" name="no_induk[]" class="span1 numbersOnly" id="2" onkeyup="movetoNext(this, '3')" maxlength="1" style="width:20px;">
                <input type = "text" name="no_induk[]" class="span1 numbersOnly" id="3" onkeyup="movetoNext(this, '4')" maxlength="1" style="width:20px;">
                <input type = "text" name="no_induk[]" class="span1 numbersOnly" id="4" onkeyup="movetoNext(this, '5')" maxlength="1" style="width:20px;">
                -
                <input type = "text" name="no_induk[]" class="span1 numbersOnly" id="5" onkeyup="movetoNext(this, '6')" maxlength="1" style="width:20px;">
                <input type = "text" name="no_induk[]" class="span1 numbersOnly" id="6" onkeyup="movetoNext(this, '7')" maxlength="1" style="width:20px;">
                -
                <input type = "text" name="no_induk[]" class="span1 numbersOnly" id="7" onkeyup="movetoNext(this, '8')" maxlength="1" style="width:20px;">
                <input type = "text" name="no_induk[]" class="span1 numbersOnly" id="8" onkeyup="movetoNext(this, '9')" maxlength="1" style="width:20px;">
                <input type = "text" name="no_induk[]" class="span1 numbersOnly" id="9" onkeyup="movetoNext(this, '10')" maxlength="1" style="width:20px;">
                -
                <input type = "text" name="no_induk[]" class="span1 numbersOnly" id="10" onkeyup="movetoNext(this, '11')" maxlength="1" style="width:20px;">
                <input type = "text" name="no_induk[]" class="span1 numbersOnly" id="11" onkeyup="movetoNext(this, '12')" maxlength="1" style="width:20px;">
                <input type = "text" name="no_induk[]" class="span1 numbersOnly" id="12" onkeyup="movetoNext(this, '13')" maxlength="1" style="width:20px;">
                -
                <input type = "text" name="no_induk[]" class="span1 numbersOnly" id="13" onkeyup="movetoNext(this, '14')" maxlength="1" style="width:20px;">
                <input type = "text" name="no_induk[]" class="span1 numbersOnly" id="14" onkeyup="movetoNext(this, '15')" maxlength="1" style="width:20px;">
                <input type = "text" name="no_induk[]" class="span1 numbersOnly" id="15" onkeyup="movetoNext(this, '16')" maxlength="1" style="width:20px;">
                <input type = "text" name="no_induk[]" class="span1 numbersOnly" id="16" onkeyup="movetoNext(this, '17')" maxlength="1" style="width:20px;">
                -
               <input type = "text" name="no_induk[]" class="span1 numbersOnly" id="17" onkeyup="movetoNext(this, '18')" maxlength="1" style="width:20px;">
        </div>
    </div>


    <div class="control-group ">
        <label class="control-label" >Nama Lengkap </label>
        <div class="controls">
            <?php echo $form->textField($model, 'nama_pemilik', array('class' => 'span3', 'maxlength' => 125)); ?>
        </div>
    </div>
    <div class="control-group ">
        <label class="control-label">Tempat Lahir </label>
        <div class="controls">
            <?php echo $form->textField($model,'tempat_lahir',array('class'=>'span3','maxlength'=>35)); ?>
        </div>
    </div>
    <div class="control-group ">
        <label class="control-label" >Tanggal Lahir</label>

        <div class="span2" style="margin:0;">
            <div class="input-group">
                <span class="input-group-addon"><i class="icon-calendar"></i></span>
                <?php
                $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                    'model' => $model,
                    'attribute' => 'tanggal_lahir',
                    // additional javascript options for the date picker plugin
                    'options' => array(
                        'yearRange' => 'c-50:c+20',
                    ),
                ));
                ?>
            </div>
        </div>

    </div>

    <div class="control-group ">
        <label class="control-label" >Jenis Kelamin</label>
        <div class="controls">
            <?php
            echo $form->DropDownList($model, 'jenis_kelamin', array(
                'prompt' => 'Pilih',
                'L'=> 'Laki-Laki',
                'P'=> 'Perempuan',
                    ), array('class' => 'span2', 'maxlength' => 2));
            ?>

        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" >Alamat </label>
        <div class="controls">
            <?php echo $form->textField($model,'alamat_pemilik',array('class'=>'span3','maxlength'=>150)); ?>
        </div>
    </div>
    <div class="control-group ">
        <label class="control-label" >RT </label>
        <div class="controls">
            <?php echo $form->textField($model,'rt',array('class'=>'span1 numbersOnly','style'=>'width:20px','maxlength'=>3)); ?>
            

            RW 
           <?php echo $form->textField($model,'rw',array('class'=>'span1 numbersOnly','style'=>'width:20px','maxlength'=>3)); ?>
            <label class="control-label">Kode Pos </label>
            <?php echo $form->textField($model,'kode_pos',array('class'=>'span1 numbersOnly','maxlength'=>10)); ?>
        </div>
    </div>
    <div class="control-group ">
        <label class="control-label" >Kecamatan </label>
        <div class="controls">
           <?php echo $form->textField($model,'kecamatan',array('class'=>'span3','maxlength'=>35)); ?>
            <?php
            $this->widget('bootstrap.widgets.TbButton', array(
                'type' => 'info',
                'label' => 'F1',
                'htmlOptions' => array('id' => 'btn_pilih_lokasi')
            ));
            ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label">Kelurahan/Desa </label>
        <div class="controls">
 <?php echo $form->textField($model,'kelurahan',array('class'=>'span3','maxlength'=>35)); ?>
        </div>
    </div>



    <div class="control-group ">
        <label class="control-label" >Kabupaten </label>
        <div class="controls">
         <?php echo $form->textField($model,'kabupaten',array('class'=>'span3','maxlength'=>35)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" >Kewarganegaraan</label>
        <div class="controls">
            <?php
            echo $form->DropDownList($model, 'warga_negara', array(
                'prompt' => 'Pilih',
                'WNI' => 'WNI',
                'WNA' => 'WNA',
                    ), array('class' => 'span1'));
            ?>

        </div>
    </div>
</div>



<div class="form-actions">
    <?php
    $this->widget('bootstrap.widgets.TbButton', array(
        'buttonType' => 'submit',
        'type' => 'success',
        'icon' => 'save',
        //'label' => $model->isNewRecord ? 'Simpan' : 'Update',
        'label' => 'Simpan',
    ));
    ?>
    <?php
    $this->widget('bootstrap.widgets.TbButton', array(
        'buttonType' => 'reset',
        'type' => 'success',
        'icon' => 'reset',
        //'label' => $model->isNewRecord ? 'Simpan' : 'Update',
        'label' => 'Batal',
    ));
    ?>
</div>


<?php $this->endWidget(); ?>
